package com.ss.android.k;

import android.content.Context;
import android.util.Log;
import android.util.SparseArray;
import android.view.View;
import com.ss.android.k.d.c;

public final class aa implements bb {
    public final View a;
    public final Context b;
    public final c c;
    public final SparseArray d;

    public aa(View arg3) {

        this.a = arg3;
        this.b = arg3.getContext();
        this.c = new c(this.a);
        this.d = new SparseArray();
    }

    public final void a(Object arg5) {
        Object v0_1;
        int v1;
        for(v1 = 0; v1 < this.d.size(); ++v1) {
            int v0 = this.d.keyAt(v1);
            View v2 = v0 == 0 ? this.a : this.c.b(v0).a;
            if(v2 == null) {
                Log.w("Presenter", "IGNORED, VIEW ID NOT FOUND:" + Integer.toHexString(this.d.keyAt(v1)));
                v0_1 = null;
            }
            else {
                v0_1 = this.d.valueAt(v1);
                ((dd)v0_1).a = v2;
            }

            if(v0_1 != null) {
                ((bb)v0_1).a(arg5);
            }
        }
    }

    public final aa a(int arg5, dd arg6) {
        Object v0 = this.d.get(arg5);
        if((((dd)v0)) != arg6) {
            arg6.b = this;
            if(v0 != null) {
                com.ss.android.k.cc v1 = new com.ss.android.k.cc(new dd[]{(dd) v0, arg6});
                ((dd)v1).b = this;
                arg6 = v1;
            }

            this.d.put(arg5, arg6);
        }

        return this;
    }
}

